package com.hyt.it.ogt.pj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hyt.it.ogt.pj.model.entity.Project;
import com.hyt.it.ogt.pj.model.vo.*;
import com.hyt.model.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * <p>
 * 评卷项目表 Mapper 接口
 * </p>
 *
 * @author qiaozj
 * @since 2020-07-09
 */
public interface ProjectMapper extends BaseMapper<Project> {

    /**
     * 评卷项目分页数据
     *
     * @param pageParam
     * @param projectName
     * @param markStatus
     * @param officeId
     * @return
     */
    Page<ProjectVo> page(Page<ProjectVo> pageParam, @Param("projectName") String projectName, @Param("markStatus") String markStatus, @Param("officeId") String officeId);


    ProjectVo getProjectMarkStatusByProjectId(@Param("projectId") String projectId, @Param("officeId") String officeId);

    /**
     * 获取评卷项目概况
     *
     * @param projectId
     * @return
     */
    ProjectOverviewVo getOverView(@Param("projectId") String projectId);


    /**
     * 获取评卷项目概况
     *
     * @param projectId
     * @return
     */
    ProjectNewVo getProjectNewVoById(@Param("projectId") String projectId, @Param("officeId") String officeId);


    /**
     * 批量获取评卷项目概况
     *
     * @param projectIds
     * @return
     */
    List<ProjectNewVo> getProjectNewVoByIds(@Param("projectIds") List<String> projectId, @Param("officeId") String officeId);


    /**
     * 获取无考场的评卷任务
     *
     * @param pageParam
     * @param projectName
     * @param examState
     * @return
     */
    IPage<ProjectVo> selectNoRoomPageProjectList(PageParam<ProjectVo> pageParam,
                                                 @Param("expertId") String expertId,
                                                 @Param("projectName") String projectName,
                                                 @Param("examState") String examState,
                                                 @Param("mobileMarkflag") int mobileMarkflag,
                                                 @Param("currDate") Date currDate);


    /**
     * 查询评卷项目分页数据
     *
     * @param pageParam
     * @param projectName
     * @param markStatus
     * @param officeId
     * @param deptIds
     * @return
     */
    Page<ProjectNewVo> pageNew(
            Page<ProjectNewVo> pageParam,
            @Param("projectName") String projectName,
            @Param("markStatus") Integer markStatus,
            @Param("officeId") String officeId,
            @Param("classfication") Integer classfication,
            @Param("ptBindingStatus") Integer ptBindingStatus,
            @Param("projectDataType") Integer projectDataType,
            @Param("deptIds") Set<String> deptIds);

    /**
     * 获取评卷进度
     *
     * @param pageParam
     * @param projectId
     * @param subjectId
     * @return
     */
    Page<MarkProgress1Vo> markProgressPage(Page<MarkProgress1Vo> pageParam, String projectId, String subjectId, String placeId, String roomId, String markModel);

    /**
     * 获取评卷进度
     *
     * @param pageParam
     * @param projectId
     * @param subjectId
     * @param expertName
     * @return
     */
    Page<MarkProgress2Vo> markProgress2Page(Page<MarkProgress2Vo> pageParam, String projectId, String subjectId, String expertName);

    /**
     * 根据项目查批次
     *
     * @param projectId
     * @return
     */
    List<OptionItemVo> getBatchByProject(String projectId);

    /**
     * 根据项目查科目
     *
     * @param projectId
     * @param needMarkCode 是否需要评卷
     * @return
     */
    List<OptionItemVo> getSubjectByProject(String projectId, Integer needMarkCode);

    /**
     * 根据项目查考点
     *
     * @param projectId
     * @return
     */
    List<OptionItemVo> getPlaceByProject(String projectId);

    /**
     * 根据项目查考场
     *
     * @param projectId
     * @return
     */
    List<OptionItemVo> getRoomByProject(String projectId, String placeId);

    /**
     * 删除评卷任务
     *
     * @param projectId
     */
    void deletePjConfig(String projectId);
    void deletePjTask(String projectId);
    void deletePjStudent(String projectId);
    void deleteStudentAnswer(String projectId);
    void deletePjPieceScore(String projectId);
    void deletePjPieceItem(String projectId);
    void deletePjPiece(String projectId);
    void deletePjPaperItem(String projectId);
    void deletePjPaper(String projectId);
    void deletePjSubjectScore(String projectId);
    void deletePjSubject(String projectId);
    void deletePjProject(String projectId);
}

